﻿using Microsoft.Extensions.DependencyInjection;
using Poem.Core;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;

namespace Poem.EF.EntityFramework
{
    [DependsOn(typeof(PoemCoreModule), typeof(AbpEntityFrameworkCoreModule))]
    public class PoemDataModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddAbpDbContext<PoemDbContext>(options =>
            {
                options.AddDefaultRepositories(includeAllEntities: true);
            });

            Configure<AbpDbContextOptions>(options =>
            {
                options.UseSqlServer(); //options => options.UseRowNumberForPaging()); //  2008,2005 分页
                //options.UseSqlite();
            });
        }
    }
}
